home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World Tours: Brazil
/
WorldTours: Brazil.iso
/
mac
/
content
/
main.dir
/
00049_Script_movie
< prev
next >
Wrap
Text File
|
2007-04-22
|
6KB
|
232 lines
global chapterCount,firstChapter,curChapter,QuestionCount,QuestionUsed,QuestionList,flvFile,quitToWhere
global quesShowList,ansShowList,curQuesNum,ansList,bingoNum
on prepareMainMenu
pMember=member(3, "external files")
repeat with i=1 to the number of members of castLib("config")
member(i, "config").text=pMember.line[i]
end repeat
if the runmode contains "plugin" then
member("quit", "config").text=member("close", "config").text
end if
pMember=member(1, "external files")
n=pMember.line.count
repeat with i=1 to n
if pMember.line[i]="" then n=n-1
end repeat
chapterCount=n/2
firstChapter=1
curChapter=1
pMember=member(2, "external files")
temp=value("["&pMember.line[1]&"]")
QuestionUsed=temp[1]
QuestionCount=temp[2]
QuestionList=[]
repeat with n=0 to QuestionCount-1
tempList=[#Ques:formatText(pMember.line[n*5+3]), #Ans1:pMember.line[n*5+4], #Ans2:pMember.line[n*5+5], #Ans3:pMember.line[n*5+6]]
append(QuestionList, tempList)
end repeat
reflashChapterList()
end
on reflashChapterList
pMember=member(1, "external files")
repeat with i=1 to 9
ChapterNo=firstChapter+i-1
if ChapterNo<=chapterCount then
member("CP"&i).text=pMember.line[2*ChapterNo-1]
member("CPTxt"&i).text=pMember.line[2*ChapterNo]
else
member("CP"&i).text=""
member("CPTxt"&i).text=""
end if
end repeat
end
on refalshChapterContent
pMember=member(1, "external files")
member("chapter caption1").text=pMember.line[2*curChapter-1]
member("chapter title").text=pMember.line[2*curChapter]
member("chapter caption2").text=member("chapter caption1").text
if the machinetype = 256 then
flvFile=the moviepath&"movie\cp"&curChapter&".flv"
else
flvFile=the moviepath&"movie:cp"&curChapter&".flv"
end if
pMember=member("chapterContent")
if member(curChapter,"chapter").type = #empty then
alert "This chapter file can not be found."
go "main"
return false
else
pMember.text=member(curChapter,"chapter").text
-- pMember.boxtype=#scroll
-- sprite(21).setFlvFile()
-- pMember.width=236
-- pMember.height=310
return true
end if
end
on gotoPreChapter
curChapter=curChapter-1
if curChapter<1 then curChapter=1
if refalshChapterContent() then sprite(21).setFlvFile()
end
on gotoNextChapter
curChapter=curChapter+1
if curChapter>chapterCount then curChapter=chapterCount
if refalshChapterContent() then sprite(21).setFlvFile()
end
on reflashQuiz
member("quesCaption").text=member("quiz caption").text&" #"&curQuesNum&":"
member("quesContent").text=QuestionList[quesShowList[curQuesNum]].ques
member("ans1").text=getprop(QuestionList[quesShowList[curQuesNum]], #ans&ansShowList[curQuesNum][1])
member("ans2").text=getprop(QuestionList[quesShowList[curQuesNum]], #ans&ansShowList[curQuesNum][2])
member("ans3").text=getprop(QuestionList[quesShowList[curQuesNum]], #ans&ansShowList[curQuesNum][3])
end
on prepareQuiz
quesShowList=[]
tempList=[]
repeat with i=1 to QuestionCount
append(tempList,i)
end repeat
repeat with i=1 to QuestionUsed
n=random(tempList.count)
append(quesShowList, tempList[n])
deleteAt(tempList, n)
end repeat
ansShowList=[]
repeat with j=1 to QuestionUsed
ansList=[]
tempList=[1,2,3]
repeat with i=1 to 3
n=random(tempList.count)
append(ansList, tempList[n])
deleteAt(tempList, n)
end repeat
append(ansShowList, ansList)
end repeat
curQuesNum=1
ansList=[]
repeat with i=1 to QuestionUsed
append(ansList, 0)
end repeat
bingoNum=0
member("right num").text=bingoNum&&"/"&&QuestionUsed
member("right rate").text="0 %"
end
on formatText str
outStr=""
the itemDelimiter="^"
n=str.item.count
repeat with i=1 to n
if i=n then
outStr=outStr&str.item[i]
else
outStr=outStr&str.item[i]&RETURN
end if
end repeat
return outStr
end
on gotoMainMenu
if the frame>marker("quiz") then
quitToWhere=#main
sprite(73).member=member("quit quiz caption")
sprite(70).show()
else
puppetTransition("wipe left")
go "main"
end if
end
on gotoVideo
puppetTransition("wipe left")
go "video"
end
on gotoQuiz
prepareQuiz()
reflashQuiz()
puppetTransition("wipe left")
go "quiz"
end
on gotoExit
quitToWhere=#windows
if the runmode contains "plugin" then
sprite(73).member=member("close caption")
else
sprite(73).member=member("quit caption")
end if
sprite(70).show()
end
on tryAgain
quitToWhere=#quiz
sprite(73).member=member("try again")
sprite(70).show()
end
on quitOrExit
case quitToWhere of
#windows:
if the runmode contains "plugin" then
gotonetpage "JavaScript:window.close()"
else
quit
end if
#main:
sprite(70).hide()
puppetTransition("wipe left")
go "main"
#quiz:
sprite(70).hide()
gotoQuiz()
end case
end
on preQues
curQuesNum=curQuesNum-1
if curQuesNum<1 then curQuesNum=1
reflashQuiz()
sprite(42).showKey()
puppetTransition("wipe left")
end
on nextQues
curQuesNum=curQuesNum+1
if curQuesNum>QuestionUsed then curQuesNum=QuestionUsed
reflashQuiz()
sprite(42).showKey()
puppetTransition("wipe right")
end
on videoPre step
put step
sprite(21).videoPre(step)
end
on videoNext step
put step
sprite(21).videoNext(step)
end